import { axiosMock, delayFn } from '@/services/axiosMock'
import type * as T from '../interface'

axiosMock('default', mock => {
  // 获取地址信息
  mock.onPost(`/tmsapi/waybill_record/getLogisticsInfo`).reply(
    delayFn<T.ILogisticsInfo>(600, () => {
      return {
        success: true,
        data: {
          carrier: 'Jsonxx',
          containerNumber: '213',
          deliveryTail: '213',
          iconType: 1,
          logisticsProduct: '123',
          merchantServersTail: '213',
          shipName: '123',
          trackingNumberList: ['123', '123'],
          voyageNumber: '1234',
          voyageUrl: 'https://oms.shipo.com',
          containerNumberUrl: 'https://oms.shipo.com',
          logisticsCode: '111',
          logisticsName: '物流渠道',
        },
      }
    }),
  )
  mock.onPost(`/tmsapi/waybill_record/updateCardInfo`).reply(
    delayFn<T.ILogisticsInfo>(600, () => {
      return {
        success: true,
      }
    }),
  )
})
